package com.sn.pw.config;

import com.sn.pw.utils.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**");//拦截所有路径
        registry.addInterceptor(new LoginInterceptor())
                .excludePathPatterns("");//不需要拦截的路径
    }
}
